#include <stdio.h>
int main(int argc, char const *argv[])
{
    int a[7];
    for (int i = 0; i < 7; i++)
    {
        printf("请输入第%d个数:>", i + 1);
        scanf("%d", &a[i]);
    }
    printf("输入的数组内容:>");
    for (int i = 0; i < 7; i++)
    {
        printf("%d ", a[i]);
    }
    printf("\n");
    for (int i = 0, t, k; i < 7 - 1; i++)
    {
        k = i;
        for (int j = i; j < 7 - 1; j++)
        {
            if (a[k] > a[j + 1])
            {
                k = j + 1;
            }
        }
        if (k != i)
        {
            t = a[i];
            a[i] = a[k];
            a[k] = t;
        }
    }
    printf("选择排序后数组内容:>");
    for (int i = 0; i < 7; i++)
    {
        printf("%d ", a[i]);
    }

    return 0;
}
